package com.dnjn.happiness.biz.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dnjn.happiness.biz.domain.TrainingTags;
import com.dnjn.happiness.biz.mapper.TrainingTagsMapper;
import com.dnjn.happiness.biz.service.ITrainingTagsService;
import com.dnjn.happiness.common.core.constant.Constants;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Amber
 * @since 2023-10-04
 */
@Service
public class TrainingTagsServiceImpl extends ServiceImpl<TrainingTagsMapper, TrainingTags> implements ITrainingTagsService {
    @Override
    public boolean removeDomain(Long pkIds) {

      return   lambdaUpdate().eq(TrainingTags::getTrainingTagsId, pkIds).set(TrainingTags::getDeleted, Constants.DELETED).update();
    }

    @Override
    public List<TrainingTags> queryListTags() {
       return lambdaQuery().eq(TrainingTags::getDeleted, Constants.UNDELETED).list();
    }

    @Override
    public TrainingTags queryByLabel(String label) {
        return lambdaQuery().eq(TrainingTags::getLabel, label).eq(TrainingTags::getDeleted,Constants.UNDELETED).one();
    }

}
